import { http, passthrough } from "msw";

export const inWhiteList = async (url: string) => {
  if (url.startsWith("http")) return false;
};

// Match all HTTP requests.
export const whitelistMiddleware = http.all("/*", async (req) => {
  // If the request is in the whitelist,
  if (await inWhiteList(req.request.url)) {
    // ...perform it as-is.
    return passthrough();
  }
});
